﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using AutoR.Helpers;
using AutoR.Messages;
using AutoR.Models;
using AutoR.Services;
using LiteDB;
using Prism.Mvvm;
using Xamarin.Forms;

namespace AutoR.Tasks
{
	// Token: 0x020000D6 RID: 214
	public class AttackTask : BindableBase
	{
		// Token: 0x1700012F RID: 303
		// (get) Token: 0x06000445 RID: 1093 RVA: 0x000408F6 File Offset: 0x0003EAF6
		protected GameData Game
		{
			get
			{
				return Runtime.Game;
			}
		}

		// Token: 0x17000130 RID: 304
		// (get) Token: 0x06000446 RID: 1094 RVA: 0x0004D93E File Offset: 0x0004BB3E
		// (set) Token: 0x06000447 RID: 1095 RVA: 0x0004D948 File Offset: 0x0004BB48
		public ObjectId Id
		{
			[CompilerGenerated]
			get
			{
				return this.<Id>k__BackingField;
			}
			[CompilerGenerated]
			set
			{
				if (this.<Id>k__BackingField == value)
				{
					return;
				}
				this.<Id>k__BackingField = value;
				this.OnPropertyChanged(<>PropertyChangedEventArgs.Id);
			}
		}

		// Token: 0x17000131 RID: 305
		// (get) Token: 0x06000448 RID: 1096 RVA: 0x0004D978 File Offset: 0x0004BB78
		// (set) Token: 0x06000449 RID: 1097 RVA: 0x0004D980 File Offset: 0x0004BB80
		public string Type
		{
			[CompilerGenerated]
			get
			{
				return this.<Type>k__BackingField;
			}
			[CompilerGenerated]
			set
			{
				if (string.Equals(this.<Type>k__BackingField, value, StringComparison.Ordinal))
				{
					return;
				}
				this.<Type>k__BackingField = value;
				this.OnPropertyChanged(<>PropertyChangedEventArgs.Type);
			}
		}

		// Token: 0x17000132 RID: 306
		// (get) Token: 0x0600044A RID: 1098 RVA: 0x0004D9B1 File Offset: 0x0004BBB1
		// (set) Token: 0x0600044B RID: 1099 RVA: 0x0004D9BC File Offset: 0x0004BBBC
		public string Name
		{
			[CompilerGenerated]
			get
			{
				return this.<Name>k__BackingField;
			}
			[CompilerGenerated]
			set
			{
				if (string.Equals(this.<Name>k__BackingField, value, StringComparison.Ordinal))
				{
					return;
				}
				this.<Name>k__BackingField = value;
				this.OnPropertyChanged(<>PropertyChangedEventArgs.Name);
			}
		}

		// Token: 0x17000133 RID: 307
		// (get) Token: 0x0600044C RID: 1100 RVA: 0x0004D9ED File Offset: 0x0004BBED
		// (set) Token: 0x0600044D RID: 1101 RVA: 0x0004D9F8 File Offset: 0x0004BBF8
		public bool Enabled
		{
			[CompilerGenerated]
			get
			{
				return this.<Enabled>k__BackingField;
			}
			[CompilerGenerated]
			set
			{
				if (this.<Enabled>k__BackingField == value)
				{
					return;
				}
				this.<Enabled>k__BackingField = value;
				this.OnPropertyChanged(<>PropertyChangedEventArgs.Enabled);
			}
		}

		// Token: 0x17000134 RID: 308
		// (get) Token: 0x0600044E RID: 1102 RVA: 0x0004DA25 File Offset: 0x0004BC25
		// (set) Token: 0x0600044F RID: 1103 RVA: 0x0004DA30 File Offset: 0x0004BC30
		public int Number
		{
			[CompilerGenerated]
			get
			{
				return this.<Number>k__BackingField;
			}
			[CompilerGenerated]
			set
			{
				if (this.<Number>k__BackingField == value)
				{
					return;
				}
				this.<Number>k__BackingField = value;
				this.OnPropertyChanged(<>PropertyChangedEventArgs.Number);
			}
		}

		// Token: 0x17000135 RID: 309
		// (get) Token: 0x06000450 RID: 1104 RVA: 0x0004DA5D File Offset: 0x0004BC5D
		// (set) Token: 0x06000451 RID: 1105 RVA: 0x0004DA68 File Offset: 0x0004BC68
		public int Order
		{
			[CompilerGenerated]
			get
			{
				return this.<Order>k__BackingField;
			}
			[CompilerGenerated]
			set
			{
				if (this.<Order>k__BackingField == value)
				{
					return;
				}
				this.<Order>k__BackingField = value;
				this.OnPropertyChanged(<>PropertyChangedEventArgs.Order);
			}
		}

		// Token: 0x17000136 RID: 310
		// (get) Token: 0x06000452 RID: 1106 RVA: 0x0004DA95 File Offset: 0x0004BC95
		// (set) Token: 0x06000453 RID: 1107 RVA: 0x0004DAA0 File Offset: 0x0004BCA0
		public string Memo
		{
			[CompilerGenerated]
			get
			{
				return this.<Memo>k__BackingField;
			}
			[CompilerGenerated]
			set
			{
				if (string.Equals(this.<Memo>k__BackingField, value, StringComparison.Ordinal))
				{
					return;
				}
				this.<Memo>k__BackingField = value;
				this.OnPropertyChanged(<>PropertyChangedEventArgs.Memo);
			}
		}

		// Token: 0x17000137 RID: 311
		// (get) Token: 0x06000454 RID: 1108 RVA: 0x0004DAD1 File Offset: 0x0004BCD1
		// (set) Token: 0x06000455 RID: 1109 RVA: 0x0004DADC File Offset: 0x0004BCDC
		public string Author
		{
			[CompilerGenerated]
			get
			{
				return this.<Author>k__BackingField;
			}
			[CompilerGenerated]
			set
			{
				if (string.Equals(this.<Author>k__BackingField, value, StringComparison.Ordinal))
				{
					return;
				}
				this.<Author>k__BackingField = value;
				this.OnPropertyChanged(<>PropertyChangedEventArgs.Author);
			}
		}

		// Token: 0x17000138 RID: 312
		// (get) Token: 0x06000456 RID: 1110 RVA: 0x0004DB0D File Offset: 0x0004BD0D
		// (set) Token: 0x06000457 RID: 1111 RVA: 0x0004DB18 File Offset: 0x0004BD18
		public int Classify
		{
			[CompilerGenerated]
			get
			{
				return this.<Classify>k__BackingField;
			}
			[CompilerGenerated]
			set
			{
				if (this.<Classify>k__BackingField == value)
				{
					return;
				}
				this.<Classify>k__BackingField = value;
				this.OnPropertyChanged(<>PropertyChangedEventArgs.ClassifyName);
				this.OnPropertyChanged(<>PropertyChangedEventArgs.Classify);
			}
		}

		// Token: 0x17000139 RID: 313
		// (get) Token: 0x06000458 RID: 1112 RVA: 0x0004DB50 File Offset: 0x0004BD50
		public string ClassifyName
		{
			get
			{
				return (new string[]
				{
					"练级",
					"资源",
					"打捞",
					"活动",
					"其他"
				})[this.Classify];
			}
		}

		// Token: 0x1700013A RID: 314
		// (get) Token: 0x06000459 RID: 1113 RVA: 0x0004DB87 File Offset: 0x0004BD87
		// (set) Token: 0x0600045A RID: 1114 RVA: 0x0004DB90 File Offset: 0x0004BD90
		public int NodeID
		{
			[CompilerGenerated]
			get
			{
				return this.<NodeID>k__BackingField;
			}
			[CompilerGenerated]
			set
			{
				if (this.<NodeID>k__BackingField == value)
				{
					return;
				}
				this.<NodeID>k__BackingField = value;
				this.OnPropertyChanged(<>PropertyChangedEventArgs.MapImage);
				this.OnPropertyChanged(<>PropertyChangedEventArgs.NodeID);
			}
		}

		// Token: 0x1700013B RID: 315
		// (get) Token: 0x0600045B RID: 1115 RVA: 0x0004DBC8 File Offset: 0x0004BDC8
		// (set) Token: 0x0600045C RID: 1116 RVA: 0x0004DBD0 File Offset: 0x0004BDD0
		public int FleetID
		{
			[CompilerGenerated]
			get
			{
				return this.<FleetID>k__BackingField;
			}
			[CompilerGenerated]
			set
			{
				if (this.<FleetID>k__BackingField == value)
				{
					return;
				}
				this.<FleetID>k__BackingField = value;
				this.OnPropertyChanged(<>PropertyChangedEventArgs.FleetID);
			}
		}

		// Token: 0x1700013C RID: 316
		// (get) Token: 0x0600045D RID: 1117 RVA: 0x0004DBFD File Offset: 0x0004BDFD
		// (set) Token: 0x0600045E RID: 1118 RVA: 0x0004DC08 File Offset: 0x0004BE08
		public ObservableCollection<AttackNode> AttackNode
		{
			[CompilerGenerated]
			get
			{
				return this.<AttackNode>k__BackingField;
			}
			[CompilerGenerated]
			set
			{
				if (object.Equals(this.<AttackNode>k__BackingField, value))
				{
					return;
				}
				this.<AttackNode>k__BackingField = value;
				this.OnPropertyChanged(<>PropertyChangedEventArgs.AttackNode);
			}
		}

		// Token: 0x1700013D RID: 317
		// (get) Token: 0x0600045F RID: 1119 RVA: 0x0004DC38 File Offset: 0x0004BE38
		// (set) Token: 0x06000460 RID: 1120 RVA: 0x0004DC40 File Offset: 0x0004BE40
		public ObservableCollection<RuleFleet> RuleFleet
		{
			[CompilerGenerated]
			get
			{
				return this.<RuleFleet>k__BackingField;
			}
			[CompilerGenerated]
			set
			{
				if (object.Equals(this.<RuleFleet>k__BackingField, value))
				{
					return;
				}
				this.<RuleFleet>k__BackingField = value;
				this.OnPropertyChanged(<>PropertyChangedEventArgs.RuleFleet);
			}
		}

		// Token: 0x1700013E RID: 318
		// (get) Token: 0x06000461 RID: 1121 RVA: 0x0004DC70 File Offset: 0x0004BE70
		// (set) Token: 0x06000462 RID: 1122 RVA: 0x0004DC78 File Offset: 0x0004BE78
		public int RepairStrategy
		{
			[CompilerGenerated]
			get
			{
				return this.<RepairStrategy>k__BackingField;
			}
			[CompilerGenerated]
			set
			{
				if (this.<RepairStrategy>k__BackingField == value)
				{
					return;
				}
				this.<RepairStrategy>k__BackingField = value;
				this.OnPropertyChanged(<>PropertyChangedEventArgs.RepairStrategy);
			}
		}

		// Token: 0x1700013F RID: 319
		// (get) Token: 0x06000463 RID: 1123 RVA: 0x0004DCA5 File Offset: 0x0004BEA5
		// (set) Token: 0x06000464 RID: 1124 RVA: 0x0004DCB0 File Offset: 0x0004BEB0
		public int[] CustomRepair
		{
			[CompilerGenerated]
			get
			{
				return this.<CustomRepair>k__BackingField;
			}
			[CompilerGenerated]
			set
			{
				if (object.Equals(this.<CustomRepair>k__BackingField, value))
				{
					return;
				}
				this.<CustomRepair>k__BackingField = value;
				this.OnPropertyChanged(<>PropertyChangedEventArgs.CustomRepair);
			}
		}

		// Token: 0x17000140 RID: 320
		// (get) Token: 0x06000465 RID: 1125 RVA: 0x0004DCE0 File Offset: 0x0004BEE0
		// (set) Token: 0x06000466 RID: 1126 RVA: 0x0004DCE8 File Offset: 0x0004BEE8
		public bool Drop
		{
			[CompilerGenerated]
			get
			{
				return this.<Drop>k__BackingField;
			}
			[CompilerGenerated]
			set
			{
				if (this.<Drop>k__BackingField == value)
				{
					return;
				}
				this.<Drop>k__BackingField = value;
				this.OnPropertyChanged(<>PropertyChangedEventArgs.Drop);
			}
		}

		// Token: 0x17000141 RID: 321
		// (get) Token: 0x06000467 RID: 1127 RVA: 0x0004DD15 File Offset: 0x0004BF15
		// (set) Token: 0x06000468 RID: 1128 RVA: 0x0004DD20 File Offset: 0x0004BF20
		public int SkipType
		{
			[CompilerGenerated]
			get
			{
				return this.<SkipType>k__BackingField;
			}
			[CompilerGenerated]
			set
			{
				if (this.<SkipType>k__BackingField == value)
				{
					return;
				}
				this.<SkipType>k__BackingField = value;
				this.OnPropertyChanged(<>PropertyChangedEventArgs.SkipType);
			}
		}

		// Token: 0x17000142 RID: 322
		// (get) Token: 0x06000469 RID: 1129 RVA: 0x0004DD4D File Offset: 0x0004BF4D
		// (set) Token: 0x0600046A RID: 1130 RVA: 0x0004DD58 File Offset: 0x0004BF58
		public string StopShip
		{
			[CompilerGenerated]
			get
			{
				return this.<StopShip>k__BackingField;
			}
			[CompilerGenerated]
			set
			{
				if (string.Equals(this.<StopShip>k__BackingField, value, StringComparison.Ordinal))
				{
					return;
				}
				this.<StopShip>k__BackingField = value;
				this.OnPropertyChanged(<>PropertyChangedEventArgs.StopShip);
			}
		}

		// Token: 0x17000143 RID: 323
		// (get) Token: 0x0600046B RID: 1131 RVA: 0x0004DD89 File Offset: 0x0004BF89
		// (set) Token: 0x0600046C RID: 1132 RVA: 0x0004DD94 File Offset: 0x0004BF94
		public int QuickRepairNumber
		{
			[CompilerGenerated]
			get
			{
				return this.<QuickRepairNumber>k__BackingField;
			}
			[CompilerGenerated]
			set
			{
				if (this.<QuickRepairNumber>k__BackingField == value)
				{
					return;
				}
				this.<QuickRepairNumber>k__BackingField = value;
				this.OnPropertyChanged(<>PropertyChangedEventArgs.QuickRepairNumber);
			}
		}

		// Token: 0x17000144 RID: 324
		// (get) Token: 0x0600046D RID: 1133 RVA: 0x0004DDC1 File Offset: 0x0004BFC1
		// (set) Token: 0x0600046E RID: 1134 RVA: 0x0004DDCC File Offset: 0x0004BFCC
		public bool CompleteRepair
		{
			[CompilerGenerated]
			get
			{
				return this.<CompleteRepair>k__BackingField;
			}
			[CompilerGenerated]
			set
			{
				if (this.<CompleteRepair>k__BackingField == value)
				{
					return;
				}
				this.<CompleteRepair>k__BackingField = value;
				this.OnPropertyChanged(<>PropertyChangedEventArgs.CompleteRepair);
			}
		}

		// Token: 0x17000145 RID: 325
		// (get) Token: 0x0600046F RID: 1135 RVA: 0x0004DDF9 File Offset: 0x0004BFF9
		// (set) Token: 0x06000470 RID: 1136 RVA: 0x0004DE04 File Offset: 0x0004C004
		public bool TaskReset
		{
			[CompilerGenerated]
			get
			{
				return this.<TaskReset>k__BackingField;
			}
			[CompilerGenerated]
			set
			{
				if (this.<TaskReset>k__BackingField == value)
				{
					return;
				}
				this.<TaskReset>k__BackingField = value;
				this.OnPropertyChanged(<>PropertyChangedEventArgs.TaskReset);
			}
		}

		// Token: 0x17000146 RID: 326
		// (get) Token: 0x06000471 RID: 1137 RVA: 0x0004DE31 File Offset: 0x0004C031
		// (set) Token: 0x06000472 RID: 1138 RVA: 0x0004DE3C File Offset: 0x0004C03C
		public int ResetNumber
		{
			[CompilerGenerated]
			get
			{
				return this.<ResetNumber>k__BackingField;
			}
			[CompilerGenerated]
			set
			{
				if (this.<ResetNumber>k__BackingField == value)
				{
					return;
				}
				this.<ResetNumber>k__BackingField = value;
				this.OnPropertyChanged(<>PropertyChangedEventArgs.ResetNumber);
			}
		}

		// Token: 0x17000147 RID: 327
		// (get) Token: 0x06000473 RID: 1139 RVA: 0x0004DE69 File Offset: 0x0004C069
		// (set) Token: 0x06000474 RID: 1140 RVA: 0x0004DE74 File Offset: 0x0004C074
		public bool RandomList
		{
			[CompilerGenerated]
			get
			{
				return this.<RandomList>k__BackingField;
			}
			[CompilerGenerated]
			set
			{
				if (this.<RandomList>k__BackingField == value)
				{
					return;
				}
				this.<RandomList>k__BackingField = value;
				this.OnPropertyChanged(<>PropertyChangedEventArgs.RandomList);
			}
		}

		// Token: 0x17000148 RID: 328
		// (get) Token: 0x06000475 RID: 1141 RVA: 0x0004DEA1 File Offset: 0x0004C0A1
		// (set) Token: 0x06000476 RID: 1142 RVA: 0x0004DEAC File Offset: 0x0004C0AC
		public bool FlagshipSL
		{
			[CompilerGenerated]
			get
			{
				return this.<FlagshipSL>k__BackingField;
			}
			[CompilerGenerated]
			set
			{
				if (this.<FlagshipSL>k__BackingField == value)
				{
					return;
				}
				this.<FlagshipSL>k__BackingField = value;
				this.OnPropertyChanged(<>PropertyChangedEventArgs.FlagshipSL);
			}
		}

		// Token: 0x17000149 RID: 329
		// (get) Token: 0x06000477 RID: 1143 RVA: 0x0004DED9 File Offset: 0x0004C0D9
		// (set) Token: 0x06000478 RID: 1144 RVA: 0x0004DEE4 File Offset: 0x0004C0E4
		public bool FlagshipBoss
		{
			[CompilerGenerated]
			get
			{
				return this.<FlagshipBoss>k__BackingField;
			}
			[CompilerGenerated]
			set
			{
				if (this.<FlagshipBoss>k__BackingField == value)
				{
					return;
				}
				this.<FlagshipBoss>k__BackingField = value;
				this.OnPropertyChanged(<>PropertyChangedEventArgs.FlagshipBoss);
			}
		}

		// Token: 0x1700014A RID: 330
		// (get) Token: 0x06000479 RID: 1145 RVA: 0x0004DF11 File Offset: 0x0004C111
		// (set) Token: 0x0600047A RID: 1146 RVA: 0x0004DF1C File Offset: 0x0004C11C
		public TimeSpan RestartTime
		{
			get
			{
				return this._restartTime;
			}
			set
			{
				if (TimeSpan.Equals(this._restartTime, value))
				{
					return;
				}
				this._restartTime = value;
				this.OnPropertyChanged(<>PropertyChangedEventArgs.RestartTime);
				this.CheckTime = Extensions.GetCheckTime(this._restartTime, false);
			}
		}

		// Token: 0x1700014B RID: 331
		// (get) Token: 0x0600047B RID: 1147 RVA: 0x0004DF5E File Offset: 0x0004C15E
		// (set) Token: 0x0600047C RID: 1148 RVA: 0x0004DF68 File Offset: 0x0004C168
		[BsonIgnore]
		public DateTime CheckTime
		{
			[CompilerGenerated]
			get
			{
				return this.<CheckTime>k__BackingField;
			}
			[CompilerGenerated]
			set
			{
				if (DateTime.Equals(this.<CheckTime>k__BackingField, value))
				{
					return;
				}
				this.<CheckTime>k__BackingField = value;
				this.OnPropertyChanged(<>PropertyChangedEventArgs.CheckTime);
			}
		}

		// Token: 0x1700014C RID: 332
		// (get) Token: 0x0600047D RID: 1149 RVA: 0x0004DF98 File Offset: 0x0004C198
		// (set) Token: 0x0600047E RID: 1150 RVA: 0x0004DFA0 File Offset: 0x0004C1A0
		public ObservableCollection<int> ShipID
		{
			get
			{
				return this._shipID;
			}
			set
			{
				if (object.Equals(this._shipID, value))
				{
					return;
				}
				this._shipID = value;
				this.OnPropertyChanged(<>PropertyChangedEventArgs.ShipName);
				this.OnPropertyChanged(<>PropertyChangedEventArgs.ShipID);
				this.ShipID.CollectionChanged += delegate(object sender, NotifyCollectionChangedEventArgs e)
				{
					base.RaisePropertyChanged("ShipName");
				};
			}
		}

		// Token: 0x1700014D RID: 333
		// (get) Token: 0x0600047F RID: 1151 RVA: 0x0004DFF4 File Offset: 0x0004C1F4
		[BsonIgnore]
		public string ShipName
		{
			get
			{
				if (this.ShipID.Count == 0)
				{
					return "点击设置";
				}
				return string.Join(",", from sid in this.ShipID
				select sid.ToName());
			}
		}

		// Token: 0x1700014E RID: 334
		// (get) Token: 0x06000480 RID: 1152 RVA: 0x0004E048 File Offset: 0x0004C248
		// (set) Token: 0x06000481 RID: 1153 RVA: 0x0004E050 File Offset: 0x0004C250
		public int StopLevel
		{
			[CompilerGenerated]
			get
			{
				return this.<StopLevel>k__BackingField;
			}
			[CompilerGenerated]
			set
			{
				if (this.<StopLevel>k__BackingField == value)
				{
					return;
				}
				this.<StopLevel>k__BackingField = value;
				this.OnPropertyChanged(<>PropertyChangedEventArgs.StopLevel);
			}
		}

		// Token: 0x1700014F RID: 335
		// (get) Token: 0x06000482 RID: 1154 RVA: 0x0004E07D File Offset: 0x0004C27D
		// (set) Token: 0x06000483 RID: 1155 RVA: 0x0004E088 File Offset: 0x0004C288
		public ObservableCollection<string> TacticsShip
		{
			get
			{
				return this._tacticsShip;
			}
			set
			{
				if (object.Equals(this._tacticsShip, value))
				{
					return;
				}
				this._tacticsShip = value;
				this.OnPropertyChanged(<>PropertyChangedEventArgs.TacticsName);
				this.OnPropertyChanged(<>PropertyChangedEventArgs.TacticsShip);
				this.TacticsShip.CollectionChanged += delegate(object sender, NotifyCollectionChangedEventArgs e)
				{
					base.RaisePropertyChanged("TacticsName");
				};
			}
		}

		// Token: 0x17000150 RID: 336
		// (get) Token: 0x06000484 RID: 1156 RVA: 0x0004E0DC File Offset: 0x0004C2DC
		[BsonIgnore]
		public string TacticsName
		{
			get
			{
				if (this.TacticsShip.Count == 0)
				{
					return "点击设置";
				}
				return string.Join(",", from sid in this.TacticsShip
				select int.Parse(sid.Split(new char[]
				{
					'|'
				})[0]).ToName());
			}
		}

		// Token: 0x17000151 RID: 337
		// (get) Token: 0x06000485 RID: 1157 RVA: 0x0004E130 File Offset: 0x0004C330
		[BsonIgnore]
		public string MapImage
		{
			get
			{
				return string.Format("{0}/Map/{1}.jpg", Runtime.ResourcePath, this.NodeID);
			}
		}

		// Token: 0x06000486 RID: 1158 RVA: 0x0004E14C File Offset: 0x0004C34C
		public async Task<bool> Prepare()
		{
			bool result;
			if (this.Number == 0)
			{
				if (this.CompleteRepair)
				{
					MessagingCenter.Send<LogMessage>(new LogMessage("[详细]任务完成后修理舰船"), "FullLog");
					foreach (UserShip item in (from i in this.Game.Fleet[this.FleetID].UserShip
					where !i.status && i.RepairTime > 0
					select i).ToList<UserShip>())
					{
						if (!this.Game.RepairTask.RepairQueue.Contains(item))
						{
							this.Game.RepairTask.RepairQueue.Enqueue(item);
						}
					}
				}
				this.Number = this.ResetNumber;
				MessagingCenter.Send<LogMessage>(new LogMessage("[任务]" + this.Name + "任务完成"), "Log");
				MessagingCenter.Send<LogMessage>(new LogMessage(this.Name + "任务完成"), "Notification");
				this.Enabled = false;
				result = false;
			}
			else if (this.ShipID.Any<int>() && this.ShipID.ToUserShipList().Any((UserShip i) => i.level >= this.StopLevel))
			{
				MessagingCenter.Send<LogMessage>(new LogMessage("[任务]到达指定等级,停止任务"), "Log");
				MessagingCenter.Send<LogMessage>(new LogMessage("到达指定等级,停止任务"), "Notification");
				this.Enabled = false;
				result = false;
			}
			else
			{
				if (this.TacticsShip.Any<string>())
				{
					if ((from i in this.Game.Tactics
					where this.TacticsShip.Any((string e) => int.Parse(e.Split(new char[]
					{
						'|'
					})[0]) == i.boat_id && int.Parse(e.Split(new char[]
					{
						'|'
					})[1]) == i.tactics_id)
					select i).Any((Tactic i) => i.IsFullLevel))
					{
						MessagingCenter.Send<LogMessage>(new LogMessage("[任务]学院满级,停止任务"), "Log");
						MessagingCenter.Send<LogMessage>(new LogMessage("学院满级,停止任务"), "Notification");
						this.Enabled = false;
						return false;
					}
				}
				if (this.Game.User.shipNumTop - this.Game.UserShip.Count <= 0)
				{
					MessagingCenter.Send<LogMessage>(new LogMessage("[任务]船舱满了，请清理后继续"), "Log");
					MessagingCenter.Send<LogMessage>(new LogMessage("船舱满了，请清理后继续"), "Notification");
					this.Enabled = false;
					result = false;
				}
				else
				{
					await Extensions.GenerateFleet(this.RuleFleet, this.FleetID, this.RandomList);
					if (!Extensions.CheckFleet(this.RuleFleet, this.FleetID))
					{
						MessagingCenter.Send<LogMessage>(new LogMessage("[任务]换船不满足设定条件,请检查,停止任务"), "Log");
						this.Enabled = false;
						result = false;
					}
					else
					{
						TaskAwaiter<bool> taskAwaiter = this.Repair().GetAwaiter();
						if (!taskAwaiter.IsCompleted)
						{
							await taskAwaiter;
							TaskAwaiter<bool> taskAwaiter2;
							taskAwaiter = taskAwaiter2;
							taskAwaiter2 = default(TaskAwaiter<bool>);
						}
						if (!taskAwaiter.GetResult())
						{
							result = false;
						}
						else
						{
							if (this.Game.GlobalConfig.Rank)
							{
								RankListDestroy destroyRank = this.Game.User.DestroyRank;
								if (destroyRank != null && destroyRank.my > 0)
								{
									List<LBDataDestroy> source = (from i in this.Game.User.DestroyRank.list
									where i.uid == Runtime.Game.User.uid
									select i).ToList<LBDataDestroy>();
									using (List<UserShip>.Enumerator enumerator = this.Game.Fleet[this.FleetID].UserShip.GetEnumerator())
									{
										while (enumerator.MoveNext())
										{
											UserShip ship = enumerator.Current;
											if (source.Any((LBDataDestroy i) => i.shipLevel == ship.level && i.shipCid == ship.shipCid))
											{
												MessagingCenter.Send<LogMessage>(new LogMessage("[任务]有船上榜，停止任务"), "Log");
												MessagingCenter.Send<LogMessage>(new LogMessage("有船上榜，停止任务"), "Notification");
												this.Enabled = false;
												return false;
											}
										}
									}
								}
							}
							if (this.Game.Fleet[this.FleetID].UserShip.Any((UserShip i) => i.IsInRepair || i.BrokenType == ShipBrokenType.BigBroken))
							{
								MessagingCenter.Send<LogMessage>(new LogMessage("[任务]有船正在修理或大破"), "FullLog");
								result = false;
							}
							else
							{
								if (this.NodeID > 1000 && this.Game.ServerType == 3 && Runtime.Configs.PVEConfig.GuardData.SingleOrDefault((GuardData i) => i.pveLevelId == this.NodeID).supAtkStatus)
								{
									MessagingCenter.Send<LogMessage>(new LogMessage("开启奇袭，正在进行补给及修理"), "FullLog");
									List<int> list = Runtime.Configs.PVEConfig.GuardData.SingleOrDefault((GuardData i) => i.pveLevelId == this.NodeID).fleet;
									await this.Game.SupplyFleet(list.ToArray(), 0);
									await this.Game.Delay(1000);
									List<UserShip> relist = (from i in list.ToUserShipList()
									where !i.IsInRepair && i.IsShipNeedRepair
									select i).ToList<UserShip>();
									if (this.RepairStrategy == 1 || this.RepairStrategy == 3)
									{
										relist = (from i in relist
										where i.BrokenType == ShipBrokenType.BigBroken
										select i).ToList<UserShip>();
									}
									if (relist.Any<UserShip>())
									{
										await this.Game.InstantRepairShip((from i in relist
										select i.id).ToList<int>());
										if (this.QuickRepairNumber > 0 && this.QuickRepairNumber < relist.Count)
										{
											MessagingCenter.Send<LogMessage>(new LogMessage("快修数量不足，关闭任务"), "Log");
											MessagingCenter.Send<LogMessage>(new LogMessage("快修数量不足，关闭任务"), "Notification");
											this.Enabled = false;
											return false;
										}
										await this.Game.InstantRepairShip((from i in relist
										select i.id).ToList<int>());
										if (this.QuickRepairNumber > 0)
										{
											this.QuickRepairNumber -= relist.Count;
											if (this.QuickRepairNumber == 0)
											{
												MessagingCenter.Send<LogMessage>(new LogMessage("快修数量为0，关闭任务"), "Log");
												MessagingCenter.Send<LogMessage>(new LogMessage("快修数量为0，关闭任务"), "Notification");
												this.Enabled = false;
												return false;
											}
										}
									}
									list = null;
									relist = null;
								}
								result = true;
							}
						}
					}
				}
			}
			return result;
		}

		// Token: 0x06000487 RID: 1159 RVA: 0x0004E194 File Offset: 0x0004C394
		private async Task<bool> Repair()
		{
			if (this.RepairStrategy == 4)
			{
				bool ire = false;
				List<UserShip> fleList = this.Game.Fleet[this.FleetID].UserShip.ToList<UserShip>();
				int num;
				for (int fi = 0; fi < fleList.Count; fi = num + 1)
				{
					UserShip userShip = fleList[fi];
					switch (this.CustomRepair[fi])
					{
					case 0:
						if (!userShip.IsInRepair && userShip.BrokenType != ShipBrokenType.NoBroken)
						{
							if (this.QuickRepairNumber > 0 && this.QuickRepairNumber < 1)
							{
								MessagingCenter.Send<LogMessage>(new LogMessage("[任务]快修数量不足，关闭任务"), "Log");
								MessagingCenter.Send<LogMessage>(new LogMessage("快修数量不足，关闭任务"), "Notification");
								this.Enabled = false;
								return false;
							}
							await this.Game.InstantRepairShip(userShip);
							if (this.QuickRepairNumber > 0)
							{
								this.QuickRepairNumber--;
								if (this.QuickRepairNumber == 0)
								{
									MessagingCenter.Send<LogMessage>(new LogMessage("[任务]快修数量为0，关闭任务"), "Log");
									MessagingCenter.Send<LogMessage>(new LogMessage("快修数量为0，关闭任务"), "Notification");
									this.Enabled = false;
									return false;
								}
							}
						}
						break;
					case 1:
						if (!userShip.IsInRepair && userShip.BrokenType == ShipBrokenType.BigBroken)
						{
							if (this.QuickRepairNumber > 0 && this.QuickRepairNumber < 1)
							{
								MessagingCenter.Send<LogMessage>(new LogMessage("[任务]快修数量不足，关闭任务"), "Log");
								MessagingCenter.Send<LogMessage>(new LogMessage("快修数量不足，关闭任务"), "Notification");
								this.Enabled = false;
								return false;
							}
							await this.Game.InstantRepairShip(userShip);
							if (this.QuickRepairNumber > 0)
							{
								this.QuickRepairNumber--;
								if (this.QuickRepairNumber == 0)
								{
									MessagingCenter.Send<LogMessage>(new LogMessage("[任务]快修数量为0，关闭任务"), "Log");
									MessagingCenter.Send<LogMessage>(new LogMessage("快修数量为0，关闭任务"), "Notification");
									this.Enabled = false;
									return false;
								}
							}
						}
						break;
					case 2:
						if (!userShip.IsInRepair && userShip.IsShipNeedRepair)
						{
							if (!this.Game.RepairTask.RepairQueue.Contains(userShip))
							{
								this.Game.RepairTask.RepairQueue.Enqueue(userShip);
							}
							ire = true;
						}
						break;
					case 3:
						if (!userShip.IsInRepair && userShip.BrokenType == ShipBrokenType.BigBroken)
						{
							if (!this.Game.RepairTask.RepairQueue.Contains(userShip))
							{
								this.Game.RepairTask.RepairQueue.Enqueue(userShip);
							}
							ire = true;
						}
						break;
					case 4:
						if (!userShip.IsInRepair && userShip.RepairTime > 0)
						{
							if (!this.Game.RepairTask.RepairQueue.Contains(userShip))
							{
								this.Game.RepairTask.RepairQueue.Enqueue(userShip);
							}
							ire = true;
						}
						break;
					}
					num = fi;
				}
				if (ire)
				{
					MessagingCenter.Send<LogMessage>(new LogMessage("[详细]有船需要进船坞修理"), "FullLog");
					return false;
				}
				fleList = null;
			}
			else
			{
				List<UserShip> fleList = (from i in this.Game.Fleet[this.FleetID].UserShip
				where !i.IsInRepair && i.IsShipNeedRepair
				select i).ToList<UserShip>();
				if (this.RepairStrategy == 1 || this.RepairStrategy == 3)
				{
					fleList = (from i in fleList
					where i.BrokenType == ShipBrokenType.BigBroken
					select i).ToList<UserShip>();
				}
				if (fleList.Any<UserShip>())
				{
					if (this.RepairStrategy == 2 || this.RepairStrategy == 3)
					{
						foreach (UserShip item in fleList)
						{
							if (!this.Game.RepairTask.RepairQueue.Contains(item))
							{
								this.Game.RepairTask.RepairQueue.Enqueue(item);
							}
						}
						MessagingCenter.Send<LogMessage>(new LogMessage("[详细]有船需要进船坞修理"), "FullLog");
						return false;
					}
					if (this.RepairStrategy == 0 || this.RepairStrategy == 1)
					{
						if (this.QuickRepairNumber > 0 && this.QuickRepairNumber < fleList.Count)
						{
							MessagingCenter.Send<LogMessage>(new LogMessage("[任务]快修数量不足，关闭任务"), "Log");
							MessagingCenter.Send<LogMessage>(new LogMessage("快修数量不足，关闭任务"), "Notification");
							this.Enabled = false;
							return false;
						}
						await this.Game.InstantRepairShip((from i in fleList
						select i.id).ToList<int>());
						if (this.QuickRepairNumber > 0)
						{
							this.QuickRepairNumber -= fleList.Count;
							if (this.QuickRepairNumber == 0)
							{
								MessagingCenter.Send<LogMessage>(new LogMessage("[任务]快修数量为0，关闭任务"), "Log");
								MessagingCenter.Send<LogMessage>(new LogMessage("快修数量为0，关闭任务"), "Notification");
								this.Enabled = false;
								return false;
							}
						}
					}
				}
				fleList = null;
			}
			return true;
		}

		// Token: 0x06000488 RID: 1160 RVA: 0x0004E1DC File Offset: 0x0004C3DC
		public async Task Start()
		{
			if (!this.Game.Fleet[this.FleetID].UserShip.Any((UserShip i) => i.IsInRepair || i.BrokenType == ShipBrokenType.BigBroken))
			{
				if (this.Game.GlobalConfig.Eat && (this.Game.User.LiveCookInfo.buff == null || DateTime.Now > this.Game.User.LiveCookInfo.buff.endtime.AddMinutes(2.0)) && this.Game.User.LiveCookInfo.eatTimes < 3)
				{
					await this.Game.EatCook();
				}
				MessagingCenter.Send<LogMessage>(new LogMessage("[详细]开始任务"), "FullLog");
				this.Game.Statistics.AttackTaskNum++;
				this.Game.Statistics.CurrentTask = this.Name;
				bool flag = false;
				if (this.Game.User.UserPVELevel.Any((UserPVELevel i) => i.id == this.NodeID))
				{
					flag = Convert.ToBoolean(this.Game.User.UserPVELevel.First((UserPVELevel i) => i.id == this.NodeID).support_status);
					MessagingCenter.Send<LogMessage>(new LogMessage(string.Format("[详细]支援补给状态: {0}", flag)), "FullLog");
				}
				MessagingCenter.Send<LogMessage>(new LogMessage("[详细]开始补给"), "FullLog");
				await this.Game.SupplyFleet(this.FleetID, flag ? this.NodeID : 0);
				List<PVENode> source = Runtime.Configs.PVEConfig.PVENode.ToList<PVENode>();
				List<PVENode> nodelist = (from i in source
				where i.pveLevelId == this.NodeID
				select i).ToList<PVENode>();
				if (nodelist.Count == 0)
				{
					MessagingCenter.Send<LogMessage>(new LogMessage("[任务]出征节点错误，请重新设置"), "FullLog");
					this.Enabled = false;
				}
				else
				{
					List<AttackNode> avnode = this.AttackNode.ToList<AttackNode>();
					Runtime.Configs.PVEConfig.PVELevel.Single((PVELevel i) => i.id == this.NodeID);
					MessagingCenter.Send<LogMessage>(new LogMessage("[详细]开始出征"), "FullLog");
					bool complete = true;
					if (this.NodeID > 1000 && this.Game.ServerType == 3)
					{
						bool flag2 = await Runtime.Remote.OceanChallenge(this.NodeID, this.FleetID + 1);
					}
					else
					{
						bool flag2 = await Runtime.Remote.Challenge(this.NodeID, this.FleetID + 1);
					}
					for (;;)
					{
						AttackTask.<>c__DisplayClass132_0 CS$<>8__locals1 = new AttackTask.<>c__DisplayClass132_0();
						UserShip userShip = this.Game.Fleet[this.FleetID].UserShip[0];
						if (userShip != null && userShip.BrokenType == ShipBrokenType.BigBroken)
						{
							break;
						}
						CS$<>8__locals1.no = ((this.NodeID <= 1000 || this.Game.ServerType != 3) ? (await Runtime.Remote.PVENext()) : (await Runtime.Remote.OceanNext()));
						CS$<>8__locals1.noc = nodelist.Single((PVENode i) => i.id == CS$<>8__locals1.no);
						MessagingCenter.Send<LogMessage>(new LogMessage("[详细]进入节点" + CS$<>8__locals1.noc.flag), "FullLog");
						await this.Game.Delay(1000);
						if (!this.AttackNode.Any((AttackNode i) => i.Node == CS$<>8__locals1.noc.flag))
						{
							goto IL_1C5B;
						}
						AttackNode node = this.AttackNode.First((AttackNode i) => i.Node == CS$<>8__locals1.noc.flag);
						if (CS$<>8__locals1.noc.IsBattleNode)
						{
							AttackTask.<>c__DisplayClass132_1 CS$<>8__locals2 = new AttackTask.<>c__DisplayClass132_1();
							if (node.IsSkip && CS$<>8__locals1.noc.CanSkip)
							{
								SkipWar skipWar = (this.NodeID <= 1000 || this.Game.ServerType != 3) ? (await Runtime.Remote.SkipWar(CS$<>8__locals1.no)) : (await Runtime.Remote.OceanSkipWar(CS$<>8__locals1.no));
								this.Game.UserShip.UpdateUserShip(skipWar.shipVO);
								if (skipWar.isSuccess)
								{
									MessagingCenter.Send<LogMessage>(new LogMessage("[详细]节点迂回成功"), "FullLog");
									avnode.Remove(node);
									this.Game.Statistics.SkipNum++;
									continue;
								}
								MessagingCenter.Send<LogMessage>(new LogMessage("节点迂回失败"), "FullLog");
								this.Game.Statistics.NotSkipNum++;
								if (this.SkipType == 0)
								{
									goto Block_22;
								}
							}
							if (this.Game.Fleet[this.FleetID].UserShip.Any((UserShip i) => i.BrokenType == ShipBrokenType.BigBroken))
							{
								goto Block_24;
							}
							MessagingCenter.Send<LogMessage>(new LogMessage("[详细]开始索敌"), "FullLog");
							FoundEnemyVO spy = (this.NodeID <= 1000 || this.Game.ServerType != 3) ? (await Runtime.Remote.PVESpy(CS$<>8__locals1.no)) : (await Runtime.Remote.OceanSpy(CS$<>8__locals1.no));
							await this.Game.Delay(1000);
							MessagingCenter.Send<LogMessage>(new LogMessage("[详细]敌方阵容：" + string.Join(", ", from i in spy.enemyShips
							select i.type.ToName())), "FullLog");
							if (node.IsFound && !Convert.ToBoolean(spy.isFound))
							{
								goto Block_29;
							}
							int num = -1;
							using (IEnumerator<NodeCondition> enumerator = node.NodeCondition.GetEnumerator())
							{
								while (enumerator.MoveNext())
								{
									AttackTask.<>c__DisplayClass132_2 CS$<>8__locals3 = new AttackTask.<>c__DisplayClass132_2();
									CS$<>8__locals3.condition = enumerator.Current;
									int[] id = new int[]
									{
										1,
										2,
										3,
										4,
										5,
										6,
										7,
										8,
										9,
										10,
										11,
										12,
										13,
										14,
										15,
										16,
										23,
										24
									};
									int num2 = spy.enemyShips.Count((ShipInWar i) => i.type == (ShipType)id[CS$<>8__locals3.condition.ShipType]);
									if ((CS$<>8__locals3.condition.Operator == 0) ? (num2 > CS$<>8__locals3.condition.Number) : ((CS$<>8__locals3.condition.Operator == 1) ? (num2 == CS$<>8__locals3.condition.Number) : (num2 < CS$<>8__locals3.condition.Number)))
									{
										if (CS$<>8__locals3.condition.Operating == 0)
										{
											MessagingCenter.Send<LogMessage>(new LogMessage("[任务]敌舰阵容触发敌舰过滤条件，回港"), "FullLog");
											await this.Game.GoHome();
											this.Game.Statistics.TrenchNum++;
											return;
										}
										num = CS$<>8__locals3.condition.Operating;
									}
								}
							}
							IEnumerator<NodeCondition> enumerator = null;
							MessagingCenter.Send<LogMessage>(new LogMessage("[详细]开打..."), "FullLog");
							if (!this.Game.GlobalConfig.AutoOneColume)
							{
								goto IL_1029;
							}
							if (!spy.enemyShips.Any((ShipInWar i) => i.type == ShipType.Submarine))
							{
								goto IL_1029;
							}
							DealNode deal = (this.NodeID <= 1000 || this.Game.ServerType != 3) ? (await Runtime.Remote.PVEDealto(CS$<>8__locals1.no, this.FleetID + 1, Formation.OneColume)) : (await Runtime.Remote.OceanDealto(CS$<>8__locals1.no, this.FleetID + 1, Formation.OneColume));
							IL_1173:
							if (this.FlagshipSL && deal.warReport.hpBeforeNightWarEnemy[0] > 0)
							{
								goto Block_41;
							}
							await this.Game.Delay(new Random().Next(this.Game.GlobalConfig.MinSeconds * 1000, this.Game.GlobalConfig.MaxSeconds * 1000));
							MessagingCenter.Send<LogMessage>(new LogMessage("[详细]获取战斗结果"), "FullLog");
							CS$<>8__locals2.result = ((this.NodeID <= 1000 || this.Game.ServerType != 3) ? (await Runtime.Remote.PVEWarResult(node.IsNightWar && deal.warReport.canDoNightWar)) : (await Runtime.Remote.OceanWarResult(node.IsNightWar && deal.warReport.canDoNightWar)));
							Extensions.UpdateShipInWar(CS$<>8__locals1.no, deal);
							this.Game.AttackSleepNum += 1f;
							this.Game.Statistics.AttackNum++;
							this.Game.Statistics.NewShipNum += CS$<>8__locals2.result.newShipVO.Count;
							var <>f__AnonymousType = CS$<>8__locals2.result.warResult.selfShipResults.Select((ShipInWarResult i, int n) => new
							{
								n,
								i.isMvp
							}).SingleOrDefault(i => i.isMvp);
							ShipInWar shipInWar = deal.warReport.selfShips.ElementAtOrDefault(<>f__AnonymousType.n);
							string text = ((shipInWar != null) ? shipInWar.UserShip.Name : null) ?? "";
							if (CS$<>8__locals2.result.newShipVO.Any<UserShip>())
							{
								string format = "[任务]{0},{1}点完成,结果:{2},MVP:{3},打捞:【{4}】";
								object[] array = new object[5];
								array[0] = this.Name;
								array[1] = CS$<>8__locals1.noc.flag;
								array[2] = CS$<>8__locals2.result.warResult.resultLevel;
								array[3] = text;
								int num3 = 4;
								UserShip userShip2 = CS$<>8__locals2.result.newShipVO.FirstOrDefault<UserShip>();
								array[num3] = ((userShip2 != null) ? userShip2.Name : null);
								MessagingCenter.Send<LogMessage>(new LogMessage(string.Format(format, array)), "Log");
								string format2 = "{0},{1}点,结果:{2},打捞:【{3}】";
								object[] array2 = new object[4];
								array2[0] = this.Name;
								array2[1] = CS$<>8__locals1.noc.flag;
								array2[2] = CS$<>8__locals2.result.warResult.resultLevel;
								int num4 = 3;
								UserShip userShip3 = CS$<>8__locals2.result.newShipVO.FirstOrDefault<UserShip>();
								array2[num4] = ((userShip3 != null) ? userShip3.Name : null);
								MessagingCenter.Send<LogMessage>(new LogMessage(string.Format(format2, array2)), "PickLog");
								Extensions.UpdateStatNewShip(CS$<>8__locals1.no, CS$<>8__locals2.result.newShipVO.FirstOrDefault<UserShip>().shipCid);
							}
							else
							{
								MessagingCenter.Send<LogMessage>(new LogMessage(string.Format("[任务]{0},{1}点完成,结果:{2},MVP:{3}", new object[]
								{
									this.Name,
									CS$<>8__locals1.noc.flag,
									CS$<>8__locals2.result.warResult.resultLevel,
									text
								})), "Log");
							}
							this.Game.UserShip.UpdateUserShip(CS$<>8__locals2.result.shipVO);
							this.Game.UserShip.UpdateUserShip(CS$<>8__locals2.result.newShipVO);
							this.Game.Tactics.UpdateTactic(CS$<>8__locals2.result.shipTactics);
							if (this.FlagshipBoss && CS$<>8__locals1.noc.nodeType == NodeType.bossBattle && CS$<>8__locals2.result.warResult.enemyShipResults[0].hp > 0)
							{
								complete = false;
								MessagingCenter.Send<LogMessage>(new LogMessage("[任务]BOOS点旗舰未消灭"), "Log");
							}
							if (CS$<>8__locals2.result.drop500 == "1" && this.Drop)
							{
								goto Block_57;
							}
							if (!string.IsNullOrEmpty(this.StopShip) && CS$<>8__locals2.result.newShipVO.Any<UserShip>() && this.StopShip.Split(new char[]
							{
								'|'
							}).ToList<string>().Any((string i) => !string.IsNullOrEmpty(i) && CS$<>8__locals2.result.newShipVO.First<UserShip>().Name.Contains(i)))
							{
								MessagingCenter.Send<LogMessage>(new LogMessage("[任务]捞到指定船【" + this.StopShip + "】,停止任务"), "Log");
								this.Enabled = false;
							}
							await this.Game.Delay(3000);
							CS$<>8__locals2 = null;
							spy = null;
							deal = null;
							goto IL_1BAF;
							IL_1029:
							deal = ((this.NodeID <= 1000 || this.Game.ServerType != 3) ? (await Runtime.Remote.PVEDealto(CS$<>8__locals1.no, this.FleetID + 1, (Formation)((num > 0) ? num : (node.Formation + 1)))) : (await Runtime.Remote.OceanDealto(CS$<>8__locals1.no, this.FleetID + 1, (Formation)((num > 0) ? num : (node.Formation + 1)))));
							goto IL_1173;
						}
						else
						{
							if (this.NodeID > 1000 && this.Game.ServerType == 3)
							{
								DealNode dealNode = await Runtime.Remote.OceanDealto(CS$<>8__locals1.no, this.FleetID + 1, Formation.OneRow);
							}
							else
							{
								DealNode dealNode = await Runtime.Remote.PVEDealto(CS$<>8__locals1.no, this.FleetID + 1, Formation.OneRow);
							}
							MessagingCenter.Send<LogMessage>(new LogMessage(string.Concat(new string[]
							{
								"[任务]",
								this.Name,
								",",
								(CS$<>8__locals1.noc.nodeType == NodeType.addItem) ? "资源点" : ((CS$<>8__locals1.noc.nodeType == NodeType.loseItem) ? "收费站" : "空白点"),
								CS$<>8__locals1.noc.flag,
								"完成"
							})), "Log");
							await this.Game.Delay(3000);
						}
						IL_1BAF:
						List<string> list = this.FindNextNode(nodelist.ToList<PVENode>(), CS$<>8__locals1.noc);
						foreach (AttackNode attackNode in avnode.ToList<AttackNode>())
						{
							if (!list.Contains(attackNode.Node))
							{
								avnode.Remove(attackNode);
							}
						}
						if (!avnode.Any<AttackNode>() || !CS$<>8__locals1.noc.nextNode.Any<int>())
						{
							goto IL_1D13;
						}
						node = null;
						CS$<>8__locals1 = null;
					}
					await this.Game.GoHome();
					MessagingCenter.Send<LogMessage>(new LogMessage("[任务]旗舰大破，回家"), "Log");
					return;
					Block_22:
					await this.Game.GoHome();
					return;
					Block_24:
					await this.Game.GoHome();
					MessagingCenter.Send<LogMessage>(new LogMessage("[任务]有船大破，回家"), "Log");
					return;
					Block_29:
					MessagingCenter.Send<LogMessage>(new LogMessage("[任务]索敌失败，回港"), "FullLog");
					await this.Game.GoHome();
					return;
					Block_41:
					await this.Game.Delay(5000);
					MessagingCenter.Send<LogMessage>(new LogMessage("[任务]节点旗舰未消灭，SL"), "Log");
					await this.Game.GoHome();
					this.Game.AttackSleepNum += 0.1f;
					this.Game.Statistics.TrenchNum++;
					return;
					Block_57:
					this.Enabled = false;
					await this.Game.GoHome();
					MessagingCenter.Send<LogMessage>(new LogMessage("[任务]达到500上限,停止任务"), "Log");
					return;
					IL_1C5B:
					MessagingCenter.Send<LogMessage>(new LogMessage("[详细]走错路(掉沟)，回港"), "FullLog");
					await this.Game.GoHome();
					this.Game.AttackSleepNum += 0.1f;
					this.Game.Statistics.TrenchNum++;
					return;
					IL_1D13:
					MessagingCenter.Send<LogMessage>(new LogMessage("[详细]完成一次战斗"), "FullLog");
					await this.Game.GoHome();
					if (complete)
					{
						this.Game.Statistics.TaskCompleteNum++;
						this.Number--;
					}
					this.Game.Statistics.CurrentTask = "";
				}
			}
		}

		// Token: 0x06000489 RID: 1161 RVA: 0x0004E224 File Offset: 0x0004C424
		public List<string> FindNextNode(List<PVENode> list, PVENode node)
		{
			list.Remove(node);
			List<string> list2 = new List<string>();
			int[] nextNode = node.nextNode;
			for (int j = 0; j < nextNode.Length; j++)
			{
				int no = nextNode[j];
				if (list.Any((PVENode i) => i.id == no))
				{
					PVENode pvenode = list.Single((PVENode i) => i.id == no);
					list2.Add(pvenode.flag);
					if (pvenode.nextNode.Length != 0)
					{
						list2.AddRange(this.FindNextNode(list, pvenode));
					}
				}
			}
			return list2.Distinct<string>().ToList<string>();
		}

		// Token: 0x0600048A RID: 1162 RVA: 0x0004E2BC File Offset: 0x0004C4BC
		public AttackTask()
		{
			this.<Id>k__BackingField = ObjectId.NewObjectId();
			this.<Type>k__BackingField = "AttackTask";
			this.<AttackNode>k__BackingField = new ObservableCollection<AttackNode>();
			this.<RuleFleet>k__BackingField = new ObservableCollection<RuleFleet>();
			this.<CustomRepair>k__BackingField = new int[6];
			this._shipID = new ObservableCollection<int>();
			this._tacticsShip = new ObservableCollection<string>();
			base..ctor();
		}

		// Token: 0x04000365 RID: 869
		private TimeSpan _restartTime;

		// Token: 0x04000367 RID: 871
		private ObservableCollection<int> _shipID;

		// Token: 0x04000369 RID: 873
		private ObservableCollection<string> _tacticsShip;
	}
}
